<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Определение позиции сайта в Яндексе</title>
</head>
<body>

<div>
<?php

require_once 'seotools.php';

error_reporting(E_ALL ^ E_WARNING);

try {
	$texts = explode("\n",$_GET['text']);
	foreach ($texts as $text)
	{
		$text = trim($text);
		if (!$text)
		{
			continue;
		}
		
		echo "[$text] ";
		$finder = new YandexPosFinder($_GET['url'], $text, $_GET['region']);

		if ($finder->foundPos())
		{
			echo 'На позиции ['.$finder->foundPos()."] найдена ссылка: <a href='".$finder->foundLink()."'>". $finder->foundLink() . '</a>';
		}
		else
		{
			echo "Не найден на ".YandexPosFinder::MAX_PAGES." первых страницах :(";
		}
		echo "<br>";
	}
}
catch(Exception $e)
{
	echo "Exception: $e";
}

?>
</div>

<div style="margin-top:20px;">
	<a href='index.htm'>Назад</a>
</div>


</body>
</html>